package comparisons

import (
	"ch05/instructions/base"
	"ch05/rtda"
)

type IF_ACMPEQ struct {
	base.BranchInstruction
}

type IF_ACMPNE struct {
	base.BranchInstruction
}

func (self *IF_ACMPEQ) Execute(frame rtda.Frame)  {
	stack := frame.OperandStack()
	ref2 := stack.PopRef()
	ref1 := stack.PopRef()
	if ref1== ref2 {
		base.Branch(frame, self.Offset)
	}
}

